main () {
// Person p = Person.wangda("老高", 18);

   Woman w = Woman(30,"章姐", "大皮靴");
   w.workForUI();
   Man m1 = Man(36, "王哥");
   m1.songName = "许巍";
   m1.workHardForMoney();
   m1.sing(m1.name!);
   m1.playBasketBall(m1.name);
   w.playBasketBall(w.name);
}

// 人的基础类
class Person {
  String? name;
  int? age;
  // Person(String name, int age) {
  //   this.age = age;
  //   this.name = name;
  // }
 
  Person(this.age,this.name); // 简写

  //Person.wangda(this.name, this.age);
  eat () {
   print("$name每天吃窝头");
  }
}

// 男人
class Man extends Person with SingUtils, SportUtils {
  Man(super.age, super.name);
  workHardForMoney () {
    print("$name $songName 为了生活而努力");
  }
}

// 女人

class Woman extends Person with SportUtils {
   String? shoes;
  //  Woman(String name, int age, String shoes) : super(0, '') {
  //   this.name = name;
  //   this.age = age;
  //   this.shoes = shoes;
  //  }
   Woman(super.age, super.name, this.shoes); // 简写
   workForUI () {
     print("$name $shoes 设计很厉害");
   }
}

// 没有构造函数的方法
mixin SingUtils {
  String? songName;
  sing (String name) {
    print("$name 有人在半夜唱 $songName 歌");
  }
}

mixin SportUtils {
  playBasketBall (String? name) {
    print("$name 有人打篮球");
  }
}